<include file="common/hearder"/>
<br>
<div class="row">
    <div class="col-lg-12">
        <a class="btn btn-primary glyphicon glyphicon-eye-close" onclick="$('#delete').submit();">批量隐藏</a>
        <a href="{:U('menu_view')}" class="btn btn-warning glyphicon glyphicon-eye-open">查看隐藏内容</a>
        <a href="{:U('add')}" class="btn btn-info glyphicon glyphicon-plus-sign">添加</a>
        <div style="float: right;" class="col-lg-4">
            <form action="">
                <div class="input-group">
                    <input type="text" name="name" class="form-control" placeholder="{$name ? $name : '请输入菜单名称查找'}">
                    <span class="input-group-btn">
                    <button class="btn btn-default" type="submit">搜索</button>
                    </span>
                </div>
            </form>
       </div>
    </div>
</div>
<br>
<form id="delete" class="am-form" action="{:U('del_all')}">
    <table class="table table-bordered">
        <tr>
            <td><input type="checkbox" class="check_all"></td>
            <td>菜单编号</td>
            <td>菜单名称</td>
            <td>模块名称</td>
            <td>视图名称</td>
            <td>操作</td>
        </tr>
        <foreach name="m_list" item="m">
            <tr>
                <td><input type="checkbox" class="check_a" name="mids[]" value="{$m.mid}"></td>
                <td>{$m.mid}</td>
                <td>{$m.name}</td>
                <td>{$m.controll}</td>
                <td>{$m.view}</td>
                <td>
                    <a href="{:U('del',array('mid'=>$m['mid'],'hidden'=>$m['hidden']))}" class="btn btn-link glyphicon glyphicon-eye-close" style="text-decoration: none;">隐藏</a>
                    <a href="{:U('edit',array('mid'=>$m['mid']))}" class="btn btn-link glyphicon glyphicon-pencil" style="text-decoration: none;">编辑</a>
                    <a href="{:U('add',array('mid'=>$m['mid']))}" class="btn btn-link glyphicon glyphicon-plus-sign" style="text-decoration: none;">添加子级菜单</a>
                </td>
            </tr>
        </foreach>
    </table>
    <div class="ys">
        共{$count}条数据
        {$show}
    </div>
</form>
<style>
    .prev,.next,.first,.end{
        font-size: 12px;
        line-height: 24px;
    }
    .current,.num,.next,.prev,.first,.end{
        display: block;
        width: 30px;
        height: 30px;
        border: 1px solid #ddd;
        text-align: center;
        /*padding: 5px 10px;*/
        float: left;
        margin: 30px 2px;
        background-color: #5bc0de;
        text-decoration: none;
        color: #e9d5d0;
    }
    .prev,.next,.end,.first{
        width: 60px;
        height: 30px;
    }
    .current {
        background-color: #f0ad4e;
        color: white;
        border: 1px solid #f0ad4e;
    }
</style>
<script>
    <!--  全选和反选prop(); prop()方法设置或返回被选元素的属性和值-->
   $('.check_all').on('click',function () {
       if($(this).prop('checked')){
           $('.check_a').each(function () {
               if($(this).prop('checked')){
                   $(this).prop('checked',false);
               }else{
                   $(this).prop('checked',true);
               }
           });
       }else{
           $('.check_a').prop('checked',false);
       }
   });
</script>
<include file="common/footer"/>